package com.demo.dao;

import com.demo.pojo.Customer;

public interface CustomerMapper {

    /**
     * 根据用户 id 查询 Customer
     *
     * @param id 用户ID
     * @return
     */
    Customer find(long id);

    /**
     * 根据用户 ID 查询 Customer （同时查询 Address ）
     *
     * @param id
     * @return
     */
    Customer findWithAddress(long id);

    /**
     * 根据 orderId 查询 Customer
     *
     * @param orderId
     * @return
     */
    Customer findByOrderId(long orderId);

    /**
     * 保存(持久化) Customer 对象
     *
     * @param customer
     * @return
     */
    int save(Customer customer);

    int update(Customer customer);

    int delete(long id);
}
